package com.zwj.design.factory.simple.factory;

import com.zwj.design.factory.simple.service.IProduct;
import com.zwj.design.factory.simple.service.impl.ProductA;
import com.zwj.design.factory.simple.service.impl.ProductB;

public class SimpleFactory {
    public static IProduct makeProduct(String productName) {
        if ("ProductA".equals(productName)) {
            return new ProductA();
        } else if ("ProductB".equals(productName)) {
            return new ProductB();
        } else {
            return null;
        }
    }
}